<template>
    <div>
        <Bread></Bread>
        <el-card>
            <!-- 权限列表渲染 -->
            <template>
                <el-table :data="right" stripe style="width: 100%">
                    <el-table-column type="index" label="#" width="80">
                    </el-table-column>
                    <el-table-column prop="authName" label="权限名称">
                    </el-table-column>
                    <el-table-column prop="path" label="路径">
                    </el-table-column>
                    <el-table-column prop="right" label="权限等级">
                        <template slot-scope="scope">
                            <el-tag type="primary" v-if="scope.row.level==0" >一级</el-tag>
                            <el-tag type="success" v-else-if="scope.row.level==1">二级</el-tag>
                            <el-tag type="warning" v-else>三级</el-tag>
                        </template>
                    </el-table-column>
                </el-table>
            </template>

        </el-card>
    </div>
</template>

<script>
import { rightList } from "@/utils/ApI(rights)/rightsAPI";
// 引入面包屑
import Bread from "../mbx.vue";
export default {
    components:{Bread},
    data() {
        return {
            right: []
        };
    },

    mounted() {
           this.getRights()
    },

    methods: {
           async getRights(){
                   let res =await rightList()
                   this.right=res.data
                //    console.log(res);
            }
    },
};
</script>

<style lang="scss" scoped>

</style>